<!-- stories/templates/stories/register.html -->
{% extends 'stories/base.html' %}
{% load static %}

{% block title %}注册 - AI故事生成网站{% endblock %}

{% block content %}
<div class="container">
    <div class="auth-container">
        <div class="auth-form">
            <div class="auth-header">
                <h1>注册</h1>
                <p>创建您的AI故事账户</p>
            </div>

            <form method="post">
                {% csrf_token %}

                <div class="form-group">
                    <label for="id_username">用户名 *</label>
                    {{ form.username }}
                    {% if form.username.errors %}
                        <div class="error-message">{{ form.username.errors }}</div>
                    {% endif %}
                </div>

                <div class="form-group">
                    <label for="id_email">邮箱 (可选)</label>
                    {{ form.email }}
                    {% if form.email.errors %}
                        <div class="error-message">{{ form.email.errors }}</div>
                    {% endif %}
                    <p class="help-text">可用于登录</p>
                </div>

                <div class="form-group">
                    <label for="id_phone">手机号 (可选)</label>
                    {{ form.phone }}
                    {% if form.phone.errors %}
                        <div class="error-message">{{ form.phone.errors }}</div>
                    {% endif %}
                </div>

                <div class="form-group">
                    <label for="id_password1">密码 *</label>
                    {{ form.password1 }}
                    {% if form.password1.errors %}
                        <div class="error-message">{{ form.password1.errors }}</div>
                    {% endif %}
                    <p class="help-text">请输入密码，无强度限制</p>
                </div>

                <div class="form-group">
                    <label for="id_password2">确认密码 *</label>
                    {{ form.password2 }}
                    {% if form.password2.errors %}
                        <div class="error-message">{{ form.password2.errors }}</div>
                    {% endif %}
                    <p class="help-text">再次输入相同密码进行确认</p>
                </div>

                <div class="form-actions">
                    <button type="submit" class="btn btn-primary">注册</button>
                </div>

                <div class="auth-links">
                    <p>已有账号？<a href="{% url 'stories:login' %}">立即登录</a></p>
                </div>
            </form>
        </div>
    </div>
</div>
{% endblock %}